<%@page import="org.apache.struts.Globals"%>
<%@include file="header.jsp"%>   

  <%-- to avoid direct access by url, check logged --%>
  <logic:present name="loginForm" scope="session">
    <jsp:forward page="/index.jsp"/>
  </logic:present>

  <%-- if button cancel was clicked --%>
  <logic:messagesPresent property="operation">
    <% request.setAttribute( Globals.ERROR_KEY, null ); %>
    <jsp:forward page="/index.jsp"/>
  </logic:messagesPresent>

  <html:form action="/registeruser">
    <table>
      <tr>
        <td><bean:message key="label.Nome"/>:</td>
        <td><input type="text" name="Nome" value="<bean:write name='registerUserForm' property='Nome'/>"/></td>
        <td><html:errors property="Nome"/></td>
      </tr>
      <tr>
        <td><bean:message key="label.Sobrenome"/>:</td>
        <td><input type="text" name="Sobrenome" value="<bean:write name='registerUserForm' property='Sobrenome'/>"/></td>
        <td><html:errors property="Sobrenome"/></td>
      </tr>
      <tr>
        <td><bean:message key="label.Login"/>:</td>
        <td><input type="text" name="Login" value="<bean:write name='registerUserForm' property='Login'/>"/></td>        
        <td><html:errors property="Login"/></td>
      </tr>
      <tr>
        <td><bean:message key="label.Senha"/>:</td>
        <td><html:password name="registerUserForm" property="Senha"/></td>
        <td><html:errors property="Senha"/></td>
      </tr>
      <tr>
        <td><bean:message key="label.confirmSenha"/>:</td>
        <td><html:password name="registerUserForm" property="confirmSenha"/></td>
        <td><html:errors property="confirmSenha"/></td>
      </tr>      
    </table>        
    <html:submit property="operation"><bean:message key="button.save"/></html:submit>
    <html:submit property="operation"><bean:message key="button.cancel"/></html:submit>
  </html:form>
    
<%@include file="footer.jsp"%>